﻿using MB.Orm.DB;
using MB.RuleBase.Common;
using Model;
using Public.DataAccess;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Business.Service
{
    public class BGoodsMove
    {
        public BGoodsMove() { }

        /// <summary>
        /// 查询搬移单信息
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="total"></param>
        /// <param name="parValues"></param>
        /// <returns></returns>
        public List<GoodsMove> GetGoodsMoveList(int pageIndex, int pageSize, out int total, params object[] parValues)
        {
            using (var DbScope = new OperationDatabaseScope(new OperationDatabaseContext("NewWeb")))
            {
                List<GoodsMove> list = PagedDatabaseExcuteByXmlHelper.NewInstance.GetPagedObjectsByXml3<GoodsMove>
                                                ("GoodsMove", "GetGoodsMoveInfo", pageIndex, pageSize, out total, parValues);
                return list;
            }
        }
        public List<GoodsMoveItem> GetGoodsMoveItemByGoodsMoveID(string GoodsMoveID)
        {
            using (var DbScope = new OperationDatabaseScope(new OperationDatabaseContext("NewWeb")))
            {
                List<GoodsMoveItem> list = DatabaseExcuteByXmlHelper.NewInstance.GetObjectsByXml<GoodsMoveItem>
                                                ("GoodsMove", "GetGoodsMoveItemByGoodsMoveID", GoodsMoveID);
                return list;
            }
        }
    }
}
